from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class Ui_launch(QtCore.QObject,object):
    def setupUi(self, launch):
        self.launch = launch
        launch.setObjectName(_fromUtf8("launch"))
        launch.resize(800, 600)
        launch.setMinimumSize(QtCore.QSize(800, 600))
        launch.setMaximumSize(QtCore.QSize(800, 600))
        self.centralWidget = QtGui.QWidget(launch)
        self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
        self.gridLayout = QtGui.QGridLayout(self.centralWidget)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.textEdit = QtGui.QTextEdit(self.centralWidget)
        self.textEdit.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.textEdit.setReadOnly(True)
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.gridLayout.addWidget(self.textEdit, 1, 0, 2, 1)
        self.pushButton_2 = QtGui.QPushButton(self.centralWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth())
        self.pushButton_2.setDisabled(True)
        self.pushButton_2.setSizePolicy(sizePolicy)
        self.pushButton_2.setMinimumSize(QtCore.QSize(0, 20))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.gridLayout.addWidget(self.pushButton_2, 1, 1, 1, 1)
        self.progressBar = QtGui.QProgressBar(self.centralWidget)
        self.progressBar.setProperty("value", 75)
        self.progressBar.setAlignment(QtCore.Qt.AlignCenter)
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.progressBar.setMinimum(0)
        self.progressBar.setMaximum(0)
        self.gridLayout.addWidget(self.progressBar, 3, 0, 1, 2)
        self.image = QtGui.QLabel(self.centralWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.image.sizePolicy().hasHeightForWidth())
        self.image.setSizePolicy(sizePolicy)
        self.image.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.image.setObjectName(_fromUtf8("image"))
        self.gridLayout.addWidget(self.image, 0, 0, 1, 2)
        self.pushButton = QtGui.QPushButton(self.centralWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
        self.pushButton.setSizePolicy(sizePolicy)
        self.pushButton.setMinimumSize(QtCore.QSize(0, 20))
        self.pushButton.setCheckable(False)
        self.pushButton.setFlat(False)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.gridLayout.addWidget(self.pushButton, 2, 1, 1, 1)
        launch.setCentralWidget(self.centralWidget)
        self.menuBar = QtGui.QMenuBar(launch)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 800, 21))
        self.menuBar.setObjectName(_fromUtf8("menuBar"))
        launch.setMenuBar(self.menuBar)
        self.mainToolBar = QtGui.QToolBar(launch)
        self.mainToolBar.setObjectName(_fromUtf8("mainToolBar"))
        launch.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)
        self.statusBar = QtGui.QStatusBar(launch)
        self.statusBar.setObjectName(_fromUtf8("statusBar"))
        launch.setStatusBar(self.statusBar)

        self.retranslateUi(launch)
        self.pushButton.setDisabled(True)
        QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL("clicked()"),self.lancer)
        QtCore.QMetaObject.connectSlotsByName(launch)
        
    def lancer(self):
        self.fenetre.show()
        self.pushButton_2.setDisabled(True)
        self.launch.close()

    def ready(self, ol):
        self.pushButton_2.setDisabled(False)
        self.fenetre = ol
        self.emit(QtCore.SIGNAL("PrepareCaching()"))
        self.textEdit.insertPlainText("Otaku-Loader est à jour\nOtaku-Loader : ready\n")
        self.textEdit.insertPlainText("Mise en cache...\n")
        self.textEdit.insertPlainText("N'hésitez pas à visiter :\nhttp://otaku-attitude.net\n")


    def retranslateUi(self, launch):
        launch.setWindowTitle(QtGui.QApplication.translate("launch", "Update & Launch - Otaku-Loader", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_2.setText(QtGui.QApplication.translate("launch", "Lancer Otaku-Loader", None, QtGui.QApplication.UnicodeUTF8))
        self.image.setText(QtGui.QApplication.translate("launch", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><img src=\"computer-girl.jpg\" width=\"800\" height=\"400\" /></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton.setText(QtGui.QApplication.translate("launch", "Mettre à jour", None, QtGui.QApplication.UnicodeUTF8))
